
from fastapi import FastAPI
from starlette.middleware.cors import CORSMiddleware
import uvicorn

app=FastAPI()

origins=[
    "http://localhost:8080",
    "http://localhost",
]

app.add_middleware(
    CORSMiddleware,
    allow_origins=["*"],
    allow_credentials=False,
    allow_methods=["*"],
    allow_headers=["*"],
)

@app.get("/")
async def root():
    print("success")

if __name__ == '__main__':
    uvicorn.run(
        app=app,
        host="0.0.0.0",
        port=8081,
        workers=1
    )